﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TouristAgencyDataLayer;

namespace TouristAgencyAsp
{
    public partial class ReservationCreated : System.Web.UI.Page
    {
        private string id;

        protected void Page_Load(object sender, EventArgs e)
        {
            id = Request.Params["resId"];

            if (id != null)
            {
                Reservation r = Reservations.GetReservationById(Convert.ToInt32(id));

                this.resIdLbl.Text = "Reservation Id: " + r.TourId.ToString();
                this.destLbl.Text = string.Format("Destination: " + r.Tour.Destination.Destination1);
                this.startLbl.Text = string.Format("Start Date: {0:dd/MM/yyyy}", r.Tour.StartDate);
                this.endLbl.Text = string.Format("End Date: {0:dd/MM/yyyy}", r.Tour.EndDate);
                this.numOfPerLbl.Text = "Number Of People Reserved: " + Reservations.NumberOfPeopleOnReservation(r.ReservationId);
                this.totalPrLbl.Text = "Total Price: " + r.TotalPrice;
                this.resTypeLbl.Text = string.Format("Reservation Type: " + r.ReservationType.ReservationType1);
            }
        }
    }
}